from lsptrain.nlp_info_extract import UIEPredictor


schema = ['品牌', "型号", "通用名", "颜色"]
predictor = UIEPredictor(model="uie-nano", schema=schema, task_path="./checkpoint/model_best", max_seq_len=64)


text = "得力（deli）0010订书钉10#(1000枚/盒)（单位：盒）"
result = predictor(text)

print(result)
# [{'型号': [{'text': '0010', 'start': 8, 'end': 12, 'probability': 0.99558866}], '通用名': [{'text': '订书钉', 'start': 12, 'end': 15, 'probability': 0.9935523}]}]
